package leetcode;

import java.util.Scanner;

/**
 * ClassName: ShuenfT1
 * Package: leetcode
 * Description:
 *
 * @Author wjn
 * @Create 2025/9/7 09:57
 * @Version 1.0
 */
public class ShuenfT2 {
    static final int MOD = 1000000007;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        if (n == 1) {
            System.out.println(9);
            return;
        }
        long dp0 = 8;
        long dp1 = 1;
        for (int i = 2; i <= n; i++) {
            long newDp0 = (dp0 + dp1) * 8 % MOD;
            long newDp1 = dp0 * 1 % MOD;
            dp0 = newDp0;
            dp1 = newDp1;
        }
        long result = (dp0 + dp1) % MOD;
        System.out.println(result);
        scanner.close();

    }
}
